/*
 * @Author       : 邱狮杰
 * @Date         : 2021-05-08 16:27:56
 * @LastEditTime : 2021-05-08 17:41:11
 * @FilePath     : /abc/js/listeningPart.js
 * @Description  :
 */
$(function () {
  $('.listeningPartModelMain').css('height', $('.listeningPartModelMain').css('height'))
  $('.listeningPartUint').next().css('height', $('.listeningPartUint').next().css('height'))
  $('.listeningPartComments').click(function () {
    const teacherCommentsModelContainer = $('.listeningPartModelMain')
    const curChildImg = $(this).children('img')
    if (teacherCommentsModelContainer.css('height') !== '0px') {
      curChildImg.css('transform', 'rotate(270deg)')
      teacherCommentsModelContainer.css('height', 0)
    } else {
      curChildImg.css('transform', 'rotate(90deg)')
      teacherCommentsModelContainer.css('height', teacherCommentsModelContainer[0].scrollHeight + 'px')
    }
  })
  $('.listeningPartUint').click(function () {
    if ($(this).next().css('height') !== '0px') {
      $(this).children('img').css('transform', 'rotate(270deg)')
      $(this).next().css('height', 0)
    } else {
      $(this).children('img').css('transform', 'rotate(90deg)')
      $(this)
        .next()
        .css('height', $(this).next()[0].scrollHeight + 'px')
    }
  })
})
